import 'osc_soft.dart';

class OscSoftRecommendListEntity {
	int code;
	OscSoftList data;
	String message;

	OscSoftRecommendListEntity({this.code, this.data, this.message});

	OscSoftRecommendListEntity.fromJson(Map<String, dynamic> json) {
		code = json['code'];
		data = json['data'] != null ? new OscSoftList.fromJson(json['data']) : null;
		message = json['message'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['code'] = this.code;
		if (this.data != null) {
      data['data'] = this.data.toJson();
    }
		data['message'] = this.message;
		return data;
	}
}

class OscSoftList {
	List<OscSoftListItem> items;
	int currentSize;

	OscSoftList({this.items, this.currentSize});

	OscSoftList.fromJson(Map<String, dynamic> json) {
		if (json['items'] != null) {
			items = new List<OscSoftListItem>();(json['items'] as List).forEach((v) { items.add(new OscSoftListItem.fromJson(v)); });
		}
		currentSize = json['currentSize'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		if (this.items != null) {
      data['items'] =  this.items.map((v) => v.toJson()).toList();
    }
		data['currentSize'] = this.currentSize;
		return data;
	}
}

class OscSoftListItem {
	OscSoft project;
	String id;
	String type;
	List<OscSoftAuthor> authors;

	OscSoftListItem({this.project, this.id, this.type, this.authors});

	OscSoftListItem.fromJson(Map<String, dynamic> json) {
		project = json['project'] != null ? new OscSoft.fromJson(json['project']) : null;
		id = json['id'];
		type = json['type'];
		if (json['authors'] != null) {
			authors = new List<OscSoftAuthor>();(json['authors'] as List).forEach((v) { authors.add(new OscSoftAuthor.fromJson(v)); });
		}
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		if (this.project != null) {
      data['project'] = this.project.toJson();
    }
		data['id'] = this.id;
		data['type'] = this.type;
		if (this.authors != null) {
      data['authors'] =  this.authors.map((v) => v.toJson()).toList();
    }
		return data;
	}
}

class OscSoftAuthor {
	int projectCount;
	int followers;
	int followStatus;
	String name;
	String project;
	String portrait;
	int userID;

	OscSoftAuthor({this.projectCount, this.followers, this.followStatus, this.name, this.project, this.portrait, this.userID});

	OscSoftAuthor.fromJson(Map<String, dynamic> json) {
		projectCount = json['projectCount'];
		followers = json['followers'];
		followStatus = json['followStatus'];
		name = json['name'];
		project = json['project'];
		portrait = json['portrait'];
		userID = json['userID'];
	}

	Map<String, dynamic> toJson() {
		final Map<String, dynamic> data = new Map<String, dynamic>();
		data['projectCount'] = this.projectCount;
		data['followers'] = this.followers;
		data['followStatus'] = this.followStatus;
		data['name'] = this.name;
		data['project'] = this.project;
		data['portrait'] = this.portrait;
		data['userID'] = this.userID;
		return data;
	}
}
